package com.foreknow.service.impl;

import com.foreknow.dao.DiseaseMapper;
import com.foreknow.entity.Disease;
import com.foreknow.service.DiseaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@SuppressWarnings("ALL")
@Service
public class DiseaseServiceImpl implements DiseaseService {
    @Autowired
    private DiseaseMapper diseaseMapper;

    @Override
    public List<Disease> selectOneList(Integer id) {
        return diseaseMapper.selectByPrimaryKey(id);
    }

    @Override
    public int addDisease(Disease record) {
        return diseaseMapper.insertSelective(record);
    }

    @Override
    public int deleteById(Integer id) {
        return diseaseMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Disease queryOne(Integer id) {
        return diseaseMapper.selectByKey(id);
    }

    @Override
    public int update(Disease disease) {
        return diseaseMapper.updateByPrimaryKeySelective(disease);
    }

    @Override
    public List<Disease> queryDouble() {
        return diseaseMapper.selectDouble();
    }
}